home *** CD-ROM | disk | FTP | other *** search
/ Apple WWDC 1996 / WWDC96_1996 (CD).toast / Technology Materials / QuickTime VR / MacOS / QuickDraw™ 3D 1.1 DR2 / Interfaces / QD3DWinViewer.h < prev   
Encoding:
C/C++ Source or Header  |  1996-03-20  |  12.8 KB  |  502 lines  |  [TEXT/MPS ]

  1. /******************************************************************************
  2.  **                                                                              **
  3.  **     Module:        QD3DWinViewer.h                                             **                        
  4.  **                                                                              **
  5.  **     Purpose:     WinViewer Controller Interface File.                     **            
  6.  **                                                                              **
  7.  **     Copyright (C) 1996 Apple Computer, Inc.  All rights reserved.         **
  8.  **                                                                              **
  9.  *****************************************************************************/
  10.  
  11. #ifndef QD3DWinViewer_h
  12. #define QD3DWinViewer_h
  13.  
  14. #include "QD3D.h"
  15. #include "QD3DGroup.h"
  16.  
  17. #if defined(OS_WINDOWS) && OS_WINDOWS
  18.  
  19. #include <windows.h>
  20.  
  21. typedef void *TQ3WinViewerObject;
  22.  
  23.  
  24. typedef TQ3Status (*TQ3WinViewerDrawingCallbackMethod)(
  25.  
  26.         TQ3WinViewerObject    theViewer,
  27.  
  28.         const void *data);
  29.  
  30.  
  31. enum {
  32.     kQ3ViewerShowBadge             = 1<<0,
  33.     kQ3ViewerActive                = 1<<1,
  34.     kQ3ViewerControllerVisible    = 1<<2,
  35.     kQ3ViewerDrawFrame            = 1<<3,
  36.     kQ3ViewerDraggingOff        = 1<<4,
  37.     
  38.     kQ3ViewerButtonCamera        = 1<<5,
  39.     kQ3ViewerButtonTruck        = 1<<6,
  40.     kQ3ViewerButtonOrbit        = 1<<7,
  41.     kQ3ViewerButtonZoom            = 1<<8,
  42.     kQ3ViewerButtonDolly        = 1<<9,
  43.     kQ3ViewerButtonReset        = 1<<10,
  44.  
  45.     
  46.  
  47.     kQ3ViewerOutputTextMode        = 1<<11,
  48.  
  49.     kQ3ViewerDragMode            = 1<<12,
  50.  
  51.  
  52.  
  53.     kQ3ViewerDrawGrowBox        = 1<<13,
  54.  
  55.     kQ3ViewerDrawDragBorder        = 1<<14,
  56.  
  57.  
  58.     kQ3ViewerDraggingInOff        = 1<<15,
  59.  
  60.     kQ3ViewerDraggingOutOff        = 1<<16,
  61.  
  62.  
  63.  
  64.     kQ3ViewerDefault            = 1<<31
  65. };
  66.  
  67.  
  68.  
  69.  
  70. enum {
  71.  
  72.     kQ3ViewerEmpty    = 0,
  73.  
  74.     kQ3ViewerHasModel = 1<<0,
  75.  
  76.     kQ3ViewerHasUndo  = 1<<1
  77.  
  78. };
  79.  
  80.  
  81.  
  82. typedef enum TQ3ViewerCameraView {
  83.  
  84.     kQ3ViewerCameraRestore,
  85.  
  86.     kQ3ViewerCameraFit,
  87.  
  88.     kQ3ViewerCameraFront,
  89.  
  90.     kQ3ViewerCameraBack,
  91.  
  92.     kQ3ViewerCameraLeft,
  93.  
  94.     kQ3ViewerCameraRight,
  95.  
  96.     kQ3ViewerCameraTop,
  97.  
  98.     kQ3ViewerCameraBottom
  99.  
  100. } TQ3ViewerCameraView;
  101.  
  102.  
  103. #ifdef __cplusplus
  104. extern "C" {
  105. #endif    /* __cplusplus */
  106.  
  107. /******************************************************************************
  108.  **                                                                             **
  109.  **        Creation and destruction                                             **
  110.  **        Note that this is not a QuickDraw 3D object                             **
  111.  **                                                                             **
  112.  *****************************************************************************/
  113.  
  114. QD3D_EXPORT TQ3WinViewerObject Q3WinViewerNew(
  115.     HWND                window,
  116.     const RECT            *rectangle,
  117.     unsigned long        flags);
  118.  
  119. QD3D_EXPORT TQ3Status Q3WinViewerDispose(
  120.     TQ3WinViewerObject    theWinViewer);
  121.  
  122. /******************************************************************************
  123.  **                                                                             **
  124.  **        Functions to attach data to a WinViewer                                 **
  125.  **                                                                             **
  126.  *****************************************************************************/
  127. QD3D_EXPORT TQ3Status Q3WinViewerUseFile(
  128.     TQ3WinViewerObject    theWinViewer,
  129.     HANDLE                fileHandle);
  130.  
  131.  
  132.  
  133. QD3D_EXPORT TQ3Status Q3WinViewerUseUnixFile (
  134.  
  135.     TQ3WinViewerObject    theWinViewer,
  136.  
  137.     FILE *file); /* temporary until we
  138.  
  139.                                                               have a win storage */
  140.  
  141. QD3D_EXPORT TQ3Status Q3WinViewerUseData(
  142.     TQ3WinViewerObject    theWinViewer,
  143.     void                *data,
  144.     unsigned long        size);
  145.  
  146. /******************************************************************************
  147.  **                                                                             **
  148.  **        Functions to write data out from the WinViewer                         **
  149.  **                                                                             **
  150.  *****************************************************************************/
  151.  
  152. QD3D_EXPORT TQ3Status Q3WinViewerWriteFile(
  153.     TQ3WinViewerObject    theWinViewer,
  154.     HANDLE                fileHandle);
  155.  
  156. QD3D_EXPORT unsigned long Q3WinViewerWriteData(
  157.     TQ3WinViewerObject    theWinViewer,
  158.     void                **data);
  159.  
  160. /******************************************************************************
  161.  **                                                                             **
  162.  **        Use this function to force the WinViewer to re-draw                     **
  163.  **                                                                             **
  164.  *****************************************************************************/
  165.  
  166. QD3D_EXPORT TQ3Status Q3WinViewerDraw(
  167.     TQ3WinViewerObject    theWinViewer);
  168.  
  169.  
  170.  
  171. QD3D_EXPORT TQ3Status Q3WinViewerDrawContent(
  172.  
  173.     TQ3WinViewerObject theViewer);
  174.  
  175.  
  176.  
  177. QD3D_EXPORT TQ3Status Q3WinViewerDrawControlStrip(
  178.  
  179.     TQ3WinViewerObject theViewer);
  180.  
  181.  
  182.  
  183. /******************************************************************************
  184.  **                                                                             **
  185.  **        Function used by the WinViewer to filter and handle events             **
  186.  **                                                                             **
  187.  *****************************************************************************/
  188.  
  189. QD3D_EXPORT TQ3Status Q3WinViewerMouseDown(
  190.     TQ3WinViewerObject    theWinViewer,
  191.     long                x,
  192.     long                y);
  193.  
  194. QD3D_EXPORT TQ3Status Q3WinViewerContinueTracking(
  195.     TQ3WinViewerObject    theWinViewer,
  196.     long                x,
  197.     long                y);
  198.  
  199. QD3D_EXPORT TQ3Status Q3WinViewerMouseUp(
  200.     TQ3WinViewerObject    theWinViewer,
  201.     long                x,
  202.     long                y);
  203.  
  204. /* TBD: Re-parameterize using params from WM_CHAR and WM_KEYDOWN, WM_KEYUP
  205.  
  206. QD3D_EXPORT TQ3Status Q3WinViewerKeyDown(
  207.     TQ3WinViewerObject    theWinViewer,
  208.     unsigned char        keyCode,
  209.     unsigned short        characterCode,
  210.     unsigned short        flags);
  211.  
  212. QD3D_EXPORT TQ3Status Q3WinViewerKeyUp(
  213.     TQ3WinViewerObject    theWinViewer,
  214.     unsigned char        keyCode,
  215.     unsigned short        characterCode,
  216.     unsigned short        flags);
  217. */
  218.  
  219. QD3D_EXPORT TQ3Status Q3WinViewerActivate(
  220.     TQ3WinViewerObject theWinViewer);
  221.  
  222. QD3D_EXPORT TQ3Status Q3WinViewerDeactivate(
  223.     TQ3WinViewerObject theWinViewer);
  224.  
  225. /******************************************************************************
  226.  **                                                                             **
  227.  **        This function returns a Bitmap of the contents of the                  **
  228.  **        WinViewer's window.  The application should dispose the Bitmap.         **
  229.  **                                                                             **
  230.  *****************************************************************************/
  231.  
  232. QD3D_EXPORT HBITMAP Q3WinViewerGetBitmap(
  233.     TQ3WinViewerObject    theWinViewer);
  234.  
  235. /******************************************************************************
  236.  **                                                                             **
  237.  **        Calls for dealing with Buttons                                         **
  238.  **                                                                             **
  239.  *****************************************************************************/
  240.  
  241. QD3D_EXPORT TQ3Status Q3WinViewerGetButtonRect(
  242.     TQ3WinViewerObject    theWinViewer,
  243.     unsigned long        button,
  244.     RECT                *rectangle);
  245.  
  246. QD3D_EXPORT unsigned long Q3WinViewerGetCurrentButton(
  247.     TQ3WinViewerObject    theWinViewer);
  248.     
  249. QD3D_EXPORT TQ3Status Q3WinViewerSetCurrentButton(
  250.     TQ3WinViewerObject    theWinViewer,
  251.     unsigned long        button);
  252.  
  253. /******************************************************************************
  254.  **                                                                             **
  255.  **        Functions to set/get the group to be displayed by the WinViewer.     **
  256.  **                                                                             **
  257.  *****************************************************************************/
  258.  
  259. QD3D_EXPORT TQ3Status Q3WinViewerUseGroup(
  260.     TQ3WinViewerObject    theWinViewer,
  261.     TQ3GroupObject        group);
  262.     
  263. QD3D_EXPORT TQ3GroupObject Q3WinViewerGetGroup(
  264.     TQ3WinViewerObject    theWinViewer);
  265.  
  266. /******************************************************************************
  267.  **                                                                             **
  268.  **        Functions to set/get the color used to clear the window                 **
  269.  **                                                                             **
  270.  *****************************************************************************/
  271.  
  272. QD3D_EXPORT TQ3Status Q3WinViewerSetBackgroundColor(
  273.     TQ3WinViewerObject    theWinViewer,
  274.     TQ3ColorARGB        *color);
  275.     
  276. QD3D_EXPORT TQ3Status Q3WinViewerGetBackgroundColor(
  277.     TQ3WinViewerObject    theWinViewer,
  278.     TQ3ColorARGB        *color);
  279.  
  280. /******************************************************************************
  281.  **                                                                             **
  282.  **        Getting/Setting a WinViewer's View object.  Disposal is needed.         **
  283.  **                                                                             **
  284.  *****************************************************************************/
  285.  
  286. QD3D_EXPORT TQ3ViewObject Q3WinViewerGetView(
  287.     TQ3WinViewerObject    theWinViewer);
  288.  
  289. QD3D_EXPORT TQ3Status Q3WinViewerRestoreView(
  290.     TQ3WinViewerObject    theWinViewer);
  291.  
  292. /******************************************************************************
  293.  **                                                                             **
  294.  **        Calls for setting/getting WinViewer flags                             **
  295.  **                                                                             **
  296.  *****************************************************************************/
  297.  
  298. QD3D_EXPORT TQ3Status Q3WinViewerSetFlags(
  299.     TQ3WinViewerObject    theWinViewer,
  300.     unsigned long        flags);
  301.  
  302. QD3D_EXPORT unsigned long Q3WinViewerGetFlags(
  303.     TQ3WinViewerObject    theWinViewer);
  304.  
  305. /******************************************************************************
  306.  **                                                                             **
  307.  **        Calls related to bounds/dimensions.  Bounds is the size of              **
  308.  **        the window.  Dimensions can either be the Rect from the ViewHints     **
  309.  **        or the current dimensions of the window (if you do a Set).             **
  310.  **                                                                             **
  311.  *****************************************************************************/
  312.  
  313. QD3D_EXPORT TQ3Status Q3WinViewerSetBounds(
  314.     TQ3WinViewerObject    theWinViewer,
  315.     RECT                *bounds);
  316.     
  317. QD3D_EXPORT TQ3Status Q3WinViewerGetBounds(
  318.     TQ3WinViewerObject    theWinViewer,
  319.     RECT                *bounds);
  320.  
  321.  
  322. QD3D_EXPORT TQ3Status Q3WinViewerSetDimension(
  323.  
  324.     TQ3WinViewerObject    theViewer,
  325.  
  326.     unsigned long    width,
  327.  
  328.     unsigned long    height);
  329.  
  330.  
  331. QD3D_EXPORT TQ3Status Q3WinViewerGetDimension(
  332.     TQ3WinViewerObject    theWinViewer,
  333.     unsigned long        *width,
  334.     unsigned long        *height);
  335.  
  336.  
  337.  
  338. QD3D_EXPORT TQ3Status Q3WinViewerGetMininumDimension(
  339.  
  340.     TQ3WinViewerObject    theViewer,
  341.  
  342.     unsigned long    *width,
  343.  
  344.     unsigned long    *height);
  345.  
  346. /******************************************************************************
  347.  **                                                                             **
  348.  **        Window related calls                                                 **
  349.  **                                                                             **
  350.  *****************************************************************************/
  351.  
  352. QD3D_EXPORT TQ3Status Q3WinViewerSetWindow(
  353.     TQ3WinViewerObject    theWinViewer,
  354.     HWND                aWindow);
  355.     
  356. QD3D_EXPORT HWND Q3WinViewerGetWindow(
  357.     TQ3WinViewerObject    theWinViewer);
  358.  
  359. /******************************************************************************
  360.  **                                                                             **
  361.  **        Adjust Cursor should be called from idle loop to allow the WinViewer **
  362.  **        to change the cursor according to the cursor position/object under     **
  363.  **        the cursor.                                                             **
  364.  **                                                                             **
  365.  *****************************************************************************/
  366.  
  367. QD3D_EXPORT TQ3Boolean Q3WinViewerAdjustCursor(
  368.     TQ3WinViewerObject    theWinViewer,
  369.     long                x,
  370.     long                y);
  371.  
  372.  
  373. QD3D_EXPORT TQ3Status Q3WinViewerCursorChanged(
  374.  
  375.     TQ3WinViewerObject    theViewer);
  376.  
  377.  
  378. /******************************************************************************
  379.  **                                                                             **
  380.  **        Returns the state of the WinViewer.  See the constant defined at the **
  381.  **        top of this file.                                                     **
  382.  **                                                                             **
  383.  *****************************************************************************/
  384.  
  385. QD3D_EXPORT unsigned long Q3WinViewerGetState(
  386.     TQ3WinViewerObject    theWinViewer);
  387.  
  388. /******************************************************************************
  389.  **                                                                             **
  390.  **        Clipboard utilities                                                     **
  391.  **                                                                             **
  392.  *****************************************************************************/
  393.  
  394. QD3D_EXPORT TQ3Status Q3WinViewerClear(
  395.     TQ3WinViewerObject    theWinViewer);
  396.     
  397. QD3D_EXPORT TQ3Status Q3WinViewerCut(
  398.     TQ3WinViewerObject    theWinViewer);
  399.     
  400. QD3D_EXPORT TQ3Status Q3WinViewerCopy(
  401.     TQ3WinViewerObject    theWinViewer);
  402.     
  403. QD3D_EXPORT TQ3Status Q3WinViewerPaste(
  404.     TQ3WinViewerObject    theWinViewer);
  405.  
  406.  
  407. /******************************************************************************
  408.  
  409.  **                                                                             **
  410.  
  411.  **        Drawing CallBack                                                     **
  412.  
  413.  **                                                                             **
  414.  
  415.  *****************************************************************************/
  416.  
  417.  
  418.  
  419. QD3D_EXPORT TQ3Status Q3WinViewerSetDrawingCallbackMethod(
  420.  
  421.         TQ3WinViewerObject                    theViewer,
  422.  
  423.         TQ3WinViewerDrawingCallbackMethod    callbackMethod,
  424.  
  425.         const void *data);
  426.  
  427.  
  428.  
  429. /******************************************************************************
  430.  
  431.  **                                                                             **
  432.  
  433.  **        Undo                                                                  **
  434.  
  435.  **                                                                             **
  436.  
  437.  *****************************************************************************/
  438.  
  439.  
  440.  
  441. QD3D_EXPORT TQ3Status     Q3WinViewerUndo(
  442.  
  443.             TQ3WinViewerObject    theViewer);
  444.  
  445.         
  446.  
  447. TQ3Boolean Q3WinViewerGetUndoString(
  448.  
  449.             TQ3WinViewerObject    theViewer, 
  450.  
  451.             char             *string,
  452.  
  453.             unsigned long     *cnt);
  454.  
  455.  
  456.  
  457. /******************************************************************************
  458.  
  459.  **                                                                             **
  460.  
  461.  **        New Camera Stuff                                                     **
  462.  
  463.  **                                                                             **
  464.  
  465.  *****************************************************************************/
  466.  
  467.  
  468.  
  469.  
  470.  
  471. QD3D_EXPORT TQ3Status Q3WinViewerGetCameraCnt(
  472.  
  473.         TQ3WinViewerObject    theViewer, 
  474.  
  475.         unsigned long     *cnt);
  476.  
  477.  
  478.  
  479. QD3D_EXPORT TQ3Status Q3WinViewerSetCameraNumber(
  480.  
  481.         TQ3WinViewerObject    theViewer, 
  482.  
  483.         unsigned long     cameraNo);
  484.  
  485.  
  486.  
  487. QD3D_EXPORT TQ3Status Q3WinViewerSetCameraView(
  488.  
  489.         TQ3WinViewerObject        theViewer, 
  490.  
  491.         TQ3ViewerCameraView viewType);
  492.  
  493.  
  494. #ifdef __cplusplus
  495. }
  496. #endif    /* __cplusplus */
  497.  
  498. #endif     /* OS_WINDOWS */
  499.  
  500. #endif    /* QD3DWinViewer_h */
  501.  
  502.